//
//  HelpViewController.swift
//  lottery
//
//  Created by admin on 16/2/4.
//  Copyright © 2016年 jin. All rights reserved.
//

import UIKit

class HelpViewController: JinBaseTableViewController {
    var helps:[Help] = Help.instanceOfFile()
    override func viewDidLoad() {
        super.viewDidLoad()
        print(helps)
        let group1 = SettingGroup()
        helps.forEach({
            val in
            group1.settings.append(Setting(title: val.title!, accessoryImage: UIImage(imageLiteral: "CellArrow")))
        })
        
        self.settings.append(group1)
    }
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        // 创建要显示的控制器
        let html = HtmlViewController()
        html.help = self.helps[indexPath.row]
        // 创建导航控制器并把要显示的控制器作为根控制器
        let nav = UINavigationController(rootViewController: html)
        // 显示模态窗口
        self.presentViewController(nav, animated: true, completion: nil)
    }
}
